package com.learn.config;

import jakarta.servlet.*;

import java.io.IOException;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/01/25
 * @description
 */
public class EncodingFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        servletRequest.setCharacterEncoding("UTF-8");
        servletResponse.setCharacterEncoding("UTF-8");
        filterChain.doFilter(servletRequest, servletResponse);
    }
}
